import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CanActivateViaAuthGuard } from './core/guards/auth.guards';
import { NotFoundComponent } from './misc/errorpages/not-found.component';


export const routes: Routes = [
    {
      path: '',
      loadChildren: './auth/user.module#UserModule'
    },
    {
      path: 'home',
      loadChildren: './home/home.module#HomeModule',
      canActivate: [CanActivateViaAuthGuard]
    },
    {
      path: 'product',
      loadChildren: './product/product-module#ProductModule',
      // children: [
      //   {path: 'modify-tag-condition',loadChildren: './product/product-module#ProductModule'}
      // ]
    },
    {
      path: 'auth',
      loadChildren: './auth/user.module#UserModule'
    },
    // {
    //   path: '**',
    //   component: NotFoundComponent
    // }
];


@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class AppRoutingModule {}
